home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / cuj9204.zip / 1004070A < prev    next >
Text File  |  1992-06-02  |  2KB  |  55 lines

  1. /******************************************************************************
  2. * Module    :   Lexical Analyzer --- Header file containing token value
  3. *               enumeration, type definitions and function prototypes for
  4. *               the lexical analyzer functions.
  5. *
  6. *               Copyright (C) 1990 John W. M. Stevens, All Rights Reserved
  7. *
  8. * Author    :   John W. M. Stevens
  9. ******************************************************************************/
  10.  
  11. #if     ! defined( LEXICAL_ANALYZER )
  12. #define     LEXICAL_ANALYZER        1
  13.  
  14. #include    <dos.h>
  15.  
  16. #define     TRUE        1
  17. #define     FALSE       0
  18. #define     ERROR       -1
  19. #define     OK          0
  20.  
  21. #define     PATH_SZ     65
  22. typedef     unsigned    int     UINT;
  23. typedef     unsigned    char    UCHAR;
  24. typedef     char        PATH[PATH_SZ];
  25.  
  26. /* Definition of structure filled in and returned by lex.   */
  27. typedef struct  {
  28.     char    str[257];
  29.     long    no;
  30.     struct  time    ftime;
  31.     struct  date    fdate;
  32. } TOKEN;
  33.  
  34. /* Token defines.   */
  35. enum    tkn_en  {
  36.     STRING = 128,
  37.     NUMBER,     TIME,       DATE,
  38.  
  39.     L_PAREN,     R_PAREN,     COMMA,       F_SLASH,     ACTION,
  40.     AFTER,       AND,         ARCHIVE,     ATTRIBUTES,  BEFORE,
  41.     DIRECTORY_T, EXEC,        FILES,       HIDDEN,      LABEL,
  42.     MODIFIED,    NAME,        NOT,         OR,          PRINT,
  43.     READONLY,    RECURS,      SEARCH,      SELECT,      SYSTEM,
  44.     L_BRACE,     BAR,         R_BRACE
  45. };
  46. typedef enum    tkn_en  TKNS;
  47.  
  48. /* Function prototypes. */
  49. extern  TKNS    Lex(TOKEN *);
  50. extern  void    OpenPrg(char *);
  51. extern  void    ParsErr(char *);
  52.  
  53. #endif
  54. /* End of File */
  55.